package com.lantosec.hmrp.modules.eval.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.eval.vo.EvalItemVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.math.BigDecimal;

/**
 * <p>
 * 考评项目定义 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvalItem extends BaseEntity<EvalItemVO> {

    private static final long serialVersionUID = 1L;
    public EvalItem(EvalItemVO vo){
        this.evalItemId = vo.getEvalItemId();
        this.evalTypeId = vo.getEvalTypeId();
        this.evalItemName = vo.getEvalItemName();
        this.applyFlag = vo.getApplyFlag();
        this.evalItemContent = vo.getEvalItemContent();
        this.standard = vo.getStandard();
        this.remark = vo.getRemark();
        this.rewardOrientation = vo.getRewardOrientation();
        this.rewardType = vo.getRewardType();
        this.rewardUpLimit = vo.getRewardUpLimit();
        this.rewardLowLimit = vo.getRewardLowLimit();
        this.rewardStandard = vo.getRewardStandard();
        this.evalTarget = vo.getEvalTarget();
        this.evalItemOrder = vo.getEvalItemOrder();
    }

    @Override
    public EvalItemVO convertToVO(){
        return new EvalItemVO(this);
    }


    /**
     * 考评项目ID
     */
    @TableId(value = "eval_item_id", type = IdType.ASSIGN_UUID)
    private String evalItemId;

    /**
     * 所属考评分类ID
     */
    private String evalTypeId;

    /**
     * 考评项目名称
     */
    private String evalItemName;

    /**
     * 是否申报项目(0否 1是)
     */
    private Integer applyFlag;

    /**
     * 考评项目内容
     */
    private String evalItemContent;

    /**
     * 考评标准
     */
    private String standard;

    /**
     * 考评说明
     */
    private String remark;

    /**
     * 考评奖惩方向(1分2钱)
     */
    private Integer rewardOrientation;

    /**
     * 考评奖惩形式(1分2钱)
     */
    private Integer rewardType;

    /**
     * 考评奖惩上限
     */
    private BigDecimal rewardUpLimit;

    /**
     * 考评奖惩下限
     */
    private BigDecimal rewardLowLimit;

    /**
     * 考评奖惩标准
     */
    private BigDecimal rewardStandard;

    /**
     * 考评对象,1科室2人员
     */
    private Integer evalTarget;

    /**
     * 排序
     */
    private Integer evalItemOrder;


    public enum ColName {
        eval_item_id, eval_type_id, eval_item_name, apply_flag, eval_item_content, standard, remark, reward_orientation, reward_type, reward_up_limit, reward_low_limit, reward_standard, eval_target, eval_item_order,
    }
}
